<template>
	<view class="mainpadding2" v-if="pageShow">
		<view class="titletext bold hei_text margin_top">订单已完成</view>
		<view class="bold xiaohei margin_top2">订单已完成，欢迎您下次购买</view>
		<view class="mainpadding_top ffffff radius">
			<view class="main_size hei_text bold flexleft">{{dataAll.orderaddress.name}} {{dataAll.orderaddress.mobile}}</view>
			<view class="margin_top1 xiaohei">{{dataAll.orderaddress.region}}{{dataAll.orderaddress.address}}</view>
		</view>
		<view class="mainpadding_top ffffff radius">
			<view class="pdl flexleft" v-for="item in dataAll.ordergoods" :key="item.goods_id" @click="jumpurl('/pages_mall/shangpinxq?id=',item.goods_id)">
				<image :src="item.goods_image_text" class="listleftimg radius" mode=""></image>
				<view class="flexcolumnbet margin_left2" style="height: 140rpx;width: 100%;">
					<view class="hei_text bold main_size yihang">{{item.goods_name}}</view>
					<view class="xiaohui">{{item.sku}}</view>
					<view class="flexbetween" style="width: 100%;">
						<view class="hong_text main_size bold">￥{{item.pay_price}}</view>
						<view class="xiaohui">*{{item.goods_num}}</view>
					</view>
				</view>
			</view>
			<view class="margin_top flexright">
				<text class="xiaohui">共计{{dataAll.total_num}}件商品，合计<text class="xiaohong bold">￥{{dataAll.total_price}}</text></text>
			</view>
		</view>
		<view class="ffffff mainpadding_top radius">
			<view class="flexbetween">
				<view class="main_size hei_text bold">订单编号</view>
				<view class="xiaohui">{{dataAll.order_no}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="main_size hei_text bold">下单时间</view>
				<view class="xiaohui">{{dataAll.paytime_text}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="main_size hei_text bold">支付方式</view>
				<view class="xiaohui">{{dataAll.pay_type_text}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				pageShow: false,
				dataAll: {},
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getDetail()
		},
		methods: {
			getDetail() {
				httpRequest.request('/api/goods_order/orderdetail', 'GET', {
					id: this.listid
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.dataAll = res.data
						this.pageShow = true
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			jumpurl(url,id){
				uni.navigateTo({
					url:url+id
				})
			}
		}
	}
</script>

<style>

</style>
